<?php

use admin\widgets\AdminToolbar;
use app\components\BaseGridView;
?>

    <?= AdminToolbar::widget(['search' => FALSE, 'dialog' => TRUE]); ?>

    <?= BaseGridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['attribute' => 'id', 'headerOptions' => ['width' => '5%']],
            'gname',
            [
                'class' => 'app\components\BaseActionColumn',
                'template' => '{view} {save}',
                'saveOptions' => ['class' => 'dialog', 'title' => '修改管理员组', 'data-width' => 500],
                'buttons' => [
                    'view' => function ($url, $model, $key) {
                        $options = ['title' => '成员列表', 'data-toggle' => 'tooltip'];
                        $url = ['user/', 'gid' => $model->id];
                        return \yii\helpers\Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $url, $options);
                    }
                ]
            ],
        ],
    ]); ?>
